import request from './request'

// 登录
export const loginApi = (username, password) => request.post('/auth/login', { username, password })

// 获取当前用户信息
export const getCurrentUserApi = () => request.get('/auth/current')

// 更新用户信息
export const updateUserApi = data => request.put('/auth/update', data)

// 修改密码
export const changePasswordApi = (oldPassword, newPassword) => request.put('/auth/change-password', { oldPassword, newPassword })

// 注册用户
export const registerApi = data => request.post('/auth/register', data)

// 获取用户信息
export const getUserInfoApi = () => request.get('/auth/current')

// 获取健康摘要
export const getHealthSummaryApi = () => request.get('/health-records/current')

// 更新用户个人资料
export const updateUserProfileApi = data => request.put('/auth/profile', data)